import dayjs from "dayjs";
function zerofill(num) {
    // 补零
    return num < 10 ? '0' + num : num;
}


// 日期转时间
export function dateConversionTime(timeStamp) {
    timeStamp = Number(timeStamp)
    let now = new Date(timeStamp);
    let year = now.getFullYear();
    let month = now.getMonth() + 1;
    let date = now.getDate();
    let hour = now.getHours();
    let minute = now.getMinutes();
    let second = now.getSeconds();
    return year + '-' + zerofill(month) + '-' + zerofill(date) + ' ' + zerofill(hour) + ":" + zerofill(minute) + ":" + zerofill(second);
}


/**
 * 获取当前时间的时间戳
 * @return number 时间戳
 */
export function returnDayValue() {
    return dayjs().valueOf();
}